﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Dainfo.Master" CodeBehind="ManterMarcas.aspx.vb" Inherits="Dainfo.ControleEstoque.Web.ManterMarcas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">


    .style3
    {
        width: 261px;
    }
    .style1
    {
        width: 139px;
    }
    .style2
    {
        width: 52px;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderTituloPagina" runat="server">
    <span class="tituloPagina">Manter Marcas</span>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderPrincipal" runat="server">
    <table style="width:100%;">
    <tr>
        <td class="style3">
            Código</td>
        <td>
            <asp:TextBox ID="txtCodigo" runat="server" Width="164px"></asp:TextBox>
        </td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style3">
            Descrição</td>
        <td>
            <asp:TextBox ID="txtDescricao" runat="server" Width="323px"></asp:TextBox>
        </td>
        <td>
        </td>
    </tr>
    <tr>
        <td class="style3">
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style3">
            <table style="width:100%;">
                <tr>
                    <td class="style1">
                        <asp:Button ID="btnSalvar" runat="server" Text="Salvar" Width="113px" />
                    </td>
                    <td class="style2">
                        <asp:Button ID="btnLimpar" runat="server" Text="Limpar" Width="113px" />
                    </td>
                </tr>
                <tr>
                    <td class="style1">
                        &nbsp;</td>
                    <td class="style2">
                        &nbsp;</td>
                </tr>
            </table>
        </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
</table>
<div style="width:500px;">
    <asp:GridView ID="GridView1" runat="server" CssClass="grid"
        AutoGenerateColumns="False" EmptyDataText="Nenhum dado encontrado." 
        DataSourceID="SqlDataSource1" BackColor="#DEBA84" BorderColor="#DEBA84" 
        BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" 
        DataKeyNames="CodMarca">
        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        <Columns>
            <asp:CommandField ShowEditButton="True" />
            <asp:BoundField DataField="CodMarca" HeaderText="Código" ReadOnly="True" />
            <asp:BoundField DataField="Descricao" HeaderText="Descrição" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DainfoDBConnectionString %>" 
        DeleteCommand="Delete from Marca Wehre CodMarca = @Codigo" 
        InsertCommand="insert into marca (descricao) values (@descricao)" 
        SelectCommand="SELECT * FROM [Marca]" 
        
        UpdateCommand="update marca set descricao = @descricao where codigo = @codigo">
        <DeleteParameters>
            <asp:ControlParameter ControlID="GridView1" Name="Codigo" 
                PropertyName="SelectedValue" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="GridView1" Name="codigo" 
                PropertyName="SelectedValue" />
            <asp:ControlParameter ControlID="GridView1" Name="descricao" 
                PropertyName="SelectedValue" />
        </UpdateParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="GridView1" Name="descricao" 
                PropertyName="SelectedValue" />
        </InsertParameters>
    </asp:SqlDataSource>
</div>
</asp:Content>
